<template>
  <div>
    <p>author info: {{author}}</p>
    <button @click="updateAuthorInfo">修改Author</button>
  </div>
</template>

<script>
    export default {
      name: "prop_sync",
      props: {
        author: {
          type:Object,
          default:function() {
            return {};
          }
        }
        // default: function () {
        //   return {
        //     id: 12,
        //     name: '张三',
        //     age: 34
        //   }
        // }
      },
      data: function () {
        return {

        }
      },
      methods: {
        updateAuthorInfo: function () {
          console.log('==updateAuthorInfo==')
          this.$emit('update:author', {
            id: 22,
            name: '李四',
            age: 55
          })
        }
      }
    }
</script>

<style scoped>

</style>
